FROM alpine:latest

RUN sed -i s@/dl-cdn.alpinelinux.org/@/mirrors.aliyun.com/@g /etc/apk/repositories\
    && apk update \
    && apk upgrade

RUN apk add make\
    && apk add --no-cache build-base\
    && apk add nodejs\
    && apk add npm\
    && npm install -g nrm yarn pnpm  \
    && nrm use taobao \
    && yarn config set registry http://registry.npmmirror.com \
    && npm config set ELECTRON_MIRROR https://npmmirror.com/mirrors/electron/ \
    && npm config set ELECTRON_CUSTOM_DIR "{{ version }}" \
    && npm config set ELECTRON_BUILDER_BINARIES_MIRROR=https://npmmirror.com/mirrors/electron-builder-binaries/ \
    && npm install -g electron \
    && npm install -g node-gyp \
    && npm install -g electron-builder

ENTRYPOINT ["/bin/sh", "-c", "\"$0\" \"$@\" "]

